package com.bnyy.medicalHousekeeper.bean;

import android.text.TextUtils;

import java.io.Serializable;

public abstract class Location implements Serializable {
    private String provname, cityname, countyname, streetname, addr;
    private int province_id, city_id, county_id, street_id;

    public String getProvname() {
        return provname;
    }

    public void setProvname(String provname) {
        this.provname = provname;
    }

    public String getCityname() {
        return cityname;
    }

    public void setCityname(String cityname) {
        this.cityname = cityname;
    }

    public String getCountyname() {
        return countyname;
    }

    public void setCountyname(String countyname) {
        this.countyname = countyname;
    }

    public String getStreetname() {
        return streetname;
    }

    public void setStreetname(String streetname) {
        this.streetname = streetname;
    }

    public String getAddr() {
        return addr;
    }

    public void setAddr(String addr) {
        this.addr = addr;
    }

    public int getProvince_id() {
        return province_id;
    }

    public void setProvince_id(int province_id) {
        this.province_id = province_id;
    }

    public int getCity_id() {
        return city_id;
    }

    public void setCity_id(int city_id) {
        this.city_id = city_id;
    }

    public int getCounty_id() {
        return county_id;
    }

    public void setCounty_id(int county_id) {
        this.county_id = county_id;
    }

    public int getStreet_id() {
        return street_id;
    }

    public void setStreet_id(int street_id) {
        this.street_id = street_id;
    }

    public String getLocation() {
        StringBuilder sb  = new StringBuilder();
        if (!TextUtils.isEmpty(provname)) {
            sb.append(provname);
        }
        if (!TextUtils.isEmpty(cityname)) {
            sb.append(cityname);
        }
        if (!TextUtils.isEmpty(countyname)) {
            sb.append(countyname);
        }
        if (!TextUtils.isEmpty(streetname)) {
            sb.append(streetname);
        }
        return sb.toString();
    }
}
